package top.lishuoboy.hutool.system.oshi;

import cn.hutool.system.oshi.OshiUtil;
import lombok.extern.slf4j.Slf4j;


@Slf4j
public class OshiUtilTest {
    public static void main(String[] args) {

        // 以下通过 OshiUtil 获取
        log.warn("{}", OshiUtil.getOs());
        log.warn("{}", OshiUtil.getCpuInfo());

        // 以下通过 OshiUtil 或 OshiUtil.getHardware() 获取
//        log.warn("{}",  HuJsonUtil.toJsonPrettyStr(OshiUtil.getHardware()));
        log.warn("{}", OshiUtil.getSystem());
//        log.warn("{}", OshiUtil.getHardware().getComputerSystem());
        log.warn("{}", OshiUtil.getProcessor());
//        log.warn("{}", OshiUtil.getHardware().getProcessor());
        log.warn("{}", OshiUtil.getMemory());
//        log.warn("{}", OshiUtil.getHardware().getMemory());
        log.warn("{}", OshiUtil.getDiskStores());
//        log.warn("{}", OshiUtil.getHardware().getDiskStores());
        log.warn("{}", OshiUtil.getNetworkIFs());
//        log.warn("{}", OshiUtil.getHardware().getNetworkIFs());
        log.warn("{}", OshiUtil.getSensors());
//        log.warn("{}", OshiUtil.getHardware().getSensors());

        // 以下通过 OshiUtil.getHardware() 获取
        log.warn("{}", OshiUtil.getHardware().getDisplays());
        log.warn("{}", OshiUtil.getHardware().getGraphicsCards());
        log.warn("{}", OshiUtil.getHardware().getPowerSources());
        log.warn("{}", OshiUtil.getHardware().getLogicalVolumeGroups());
        log.warn("{}", OshiUtil.getHardware().getSoundCards());
        log.warn("{}", OshiUtil.getHardware().getUsbDevices(true));

/*

"C:\Program Files\Java\jdk-17.0.5\bin\java.exe" "-javaagent:D:\Program Files\JetBrains\IntelliJ IDEA 2022.2.3\lib\idea_rt.jar=56334:D:\Program Files\JetBrains\IntelliJ IDEA 2022.2.3\bin" -Dfile.encoding=UTF-8 -classpath D:\workspace\lishuoboy-hutool\target\classes;C:\Users\25135\.m2\repository\cn\hutool\hutool-all\5.7.22\hutool-all-5.7.22.jar;C:\Users\25135\.m2\repository\com\sun\mail\javax.mail\1.6.2\javax.mail-1.6.2.jar;C:\Users\25135\.m2\repository\javax\activation\activation\1.1\activation-1.1.jar;C:\Users\25135\.m2\repository\mysql\mysql-connector-java\8.0.27\mysql-connector-java-8.0.27.jar;C:\Users\25135\.m2\repository\com\zaxxer\HikariCP\3.4.5\HikariCP-3.4.5.jar;C:\Users\25135\.m2\repository\org\slf4j\slf4j-api\1.7.32\slf4j-api-1.7.32.jar;C:\Users\25135\.m2\repository\com\github\oshi\oshi-core\6.3.2\oshi-core-6.3.2.jar;C:\Users\25135\.m2\repository\net\java\dev\jna\jna\5.12.1\jna-5.12.1.jar;C:\Users\25135\.m2\repository\net\java\dev\jna\jna-platform\5.12.1\jna-platform-5.12.1.jar;C:\Users\25135\.m2\repository\top\lishuoboy\lishuoboy-dependency-base\1.0-SNAPSHOT\lishuoboy-dependency-base-1.0-SNAPSHOT.jar;C:\Users\25135\.m2\repository\com\alibaba\fastjson\1.2.80\fastjson-1.2.80.jar;C:\Users\25135\.m2\repository\org\webjars\jquery\3.6.0\jquery-3.6.0.jar;C:\Users\25135\.m2\repository\org\projectlombok\lombok\1.18.22\lombok-1.18.22.jar;C:\Users\25135\.m2\repository\ch\qos\logback\logback-classic\1.2.7\logback-classic-1.2.7.jar;C:\Users\25135\.m2\repository\ch\qos\logback\logback-core\1.2.7\logback-core-1.2.7.jar;C:\Users\25135\.m2\repository\junit\junit\4.13.2\junit-4.13.2.jar;C:\Users\25135\.m2\repository\org\hamcrest\hamcrest-core\2.2\hamcrest-core-2.2.jar;C:\Users\25135\.m2\repository\org\hamcrest\hamcrest\2.2\hamcrest-2.2.jar;C:\Users\25135\.m2\repository\org\bouncycastle\bcprov-jdk15to18\1.69\bcprov-jdk15to18-1.69.jar top.lishuoboy.hutool.system.oshi.OshiUtilTest
[ WARN]   12 : Microsoft Windows 11 (Home) build 22621
[ WARN]   13 : CpuInfo{CPU核心数=16, CPU总的使用率=16268.0, CPU系统使用率=0.1, CPU用户使用率=0.39, CPU当前等待率=0.0, CPU当前空闲率=99.42, CPU利用率=0.58, CPU型号信息='12th Gen Intel(R) Core(TM) i5-1240P
 1 physical CPU package(s)
 12 physical CPU core(s) (4 performance + 8 efficiency)
 16 logical CPU(s)
Identifier: Intel64 Family 6 Model 154 Stepping 3
ProcessorID: BFEBFBFF000906A3
microarchitecture: Alder Lake'}
[ WARN]   17 : manufacturer=HP, model=HP ZHAN 66 Pro 14 inch G5 Notebook PC, serial number=5CD226525W, uuid=6431CC88-EFFF-4BAF-96A0-5CD63A004F40
[ WARN]   19 : 12th Gen Intel(R) Core(TM) i5-1240P
 1 physical CPU package(s)
 12 physical CPU core(s) (4 performance + 8 efficiency)
 16 logical CPU(s)
Identifier: Intel64 Family 6 Model 154 Stepping 3
ProcessorID: BFEBFBFF000906A3
Microarchitecture: Alder Lake
[ WARN]   21 : Available: 18.6 GiB/31.6 GiB
[ WARN]   23 : [\\.\PHYSICALDRIVE0: (model: SAMSUNG MZVL2512HCJQ-00BH1 (标准磁盘驱动器) - S/N: 0025_38B4_21B6_99CC.) size: 512.1 GB, reads: 186196 (4.5 GiB), writes: 111434 (4.4 GiB), xfer: 45105]
[ WARN]   25 : [Name: wlan0 (Microsoft Wi-Fi Direct Virtual Adapter) [IfAlias=本地连接* 1]
  MAC Address: 54:6c:eb:a8:81:c2
  MTU: 1500, Speed: 0
  IPv4: []
  IPv6: [fe80:0:0:0:f74a:ff76:e15b:3feb/64]
  Traffic: received 0 packets/0 bytes (0 err, 0 drop); transmitted 0 packets/0 bytes (0 err, 0 coll);, Name: eth3 (Realtek PCIe GbE Family Controller) [IfAlias=以太网]
  MAC Address: 5c:60:ba:59:c6:91
  MTU: 1500, Speed: 0
  IPv4: []
  IPv6: [fe80:0:0:0:568e:b0b6:8e98:f9bd/64]
  Traffic: received 0 packets/0 bytes (0 err, 0 drop); transmitted 0 packets/0 bytes (0 err, 0 coll);, Name: wlan1 (Intel(R) Wi-Fi 6E AX211 160MHz) [IfAlias=WLAN]
  MAC Address: 54:6c:eb:a8:81:c1
  MTU: 1500, Speed: 351000000
  IPv4: [192.168.0.111/24]
  IPv6: [fe80:0:0:0:aea2:a32d:3736:4d09/64]
  Traffic: received 46070 packets/35.7 MiB (0 err, 0 drop); transmitted 35105 packets/6.4 MiB (0 err, 0 coll);, Name: wlan2 (Microsoft Wi-Fi Direct Virtual Adapter #2) [IfAlias=本地连接* 2]
  MAC Address: 56:6c:eb:a8:81:c1
  MTU: 1500, Speed: 0
  IPv4: []
  IPv6: [fe80:0:0:0:4950:222c:3513:fa77/64]
  Traffic: received 0 packets/0 bytes (0 err, 0 drop); transmitted 0 packets/0 bytes (0 err, 0 coll);, Name: eth4 (Bluetooth Device (Personal Area Network)) [IfAlias=蓝牙网络连接]
  MAC Address: 54:6c:eb:a8:81:c5
  MTU: 1500, Speed: 3000000
  IPv4: []
  IPv6: [fe80:0:0:0:a774:57b6:b213:cb17/64]
  Traffic: received 0 packets/0 bytes (0 err, 0 drop); transmitted 0 packets/0 bytes (0 err, 0 coll);]
[ WARN]   27 : CPU Temperature=0.0°C, Fan Speeds=[], CPU Voltage=0.0
[ WARN]   31 : [  Manuf. ID=PHL, Product ID=c183, Digital, Serial=0000ﾬ5C, ManufDate=5/2018, EDID v1.3
  52 x 29 cm (20.5 x 11.4 in)
  Preferred Timing: Clock 148MHz, Active Pixels 1920x1080
  Preferred Timing: Clock 174MHz, Active Pixels 1920x1080
  Monitor Name: PHL 243E9Q
  Range Limits: Field Rate 48-76 Hz vertical, 30-85 Hz horizontal, Max clock: 180 MHz]
[ WARN]   32 : [GraphicsCard@16150369 [name=Intel(R) Iris(R) Xe Graphics, deviceId=0x46a6, vendor=Intel Corporation (0x8086), vRam=1073741824, versionInfo=[DriverVersion=31.0.101.3358]]]
[ WARN]   33 : [Name: System Battery, Device Name: Primary,
 RemainingCapacityPercent: 100.0%, Time Remaining: Unknown, Time Remaining Instant: Unknown,
 Power Usage Rate: 0.0mW, Voltage: 12.838V, Amperage: 0.0mA,
 Power OnLine: true, Charging: false, Discharging: false,
 Capacity Units: MWH, Current Capacity: 47003, Max Capacity: 49145, Design Capacity: 51310,
 Cycle Count: 12, Chemistry: LIon, Manufacture Date: unknown, Manufacturer: Hewlett-Packard,
 SerialNumber: 04325 2022/06/09, Temperature: unknown]
[ WARN]   34 : []
[ WARN]   35 : [SoundCard@23941fb4 [name=Microsoft Microsoft Bluetooth A2dp Source, kernelVersion=BthA2dp.sys 10.0.22621.1, codec=Microsoft Bluetooth A2dp Source], SoundCard@7486b455 [name=Intel(R) Corporation 适用于数字麦克风的英特尔® 智音技术, kernelVersion=IntcDMic.sys 10.29.0.7767, codec=适用于数字麦克风的英特尔® 智音技术], SoundCard@660acfb [name=Intel(R) Corporation 适用于 USB 音频的英特尔® 智音技术, kernelVersion=IntcUSB.sys 10.29.0.7767, codec=适用于 USB 音频的英特尔® 智音技术], SoundCard@5d908d47 [name=Realtek Semiconductor Corp. Realtek High Definition Audio, kernelVersion=RTKVHD64.sys 6.0.9400.1, codec=Realtek High Definition Audio], SoundCard@5efa40fe [name=Intel(R) Corporation 适用于蓝牙® 音频的英特尔® 智音技术, kernelVersion=IntcBTAu.sys 10.29.0.7767, codec=适用于蓝牙® 音频的英特尔® 智音技术], SoundCard@1f9f6368 [name=Intel Corporation HD Audio Driver for Display Audio, kernelVersion=AcxHdAudio.sys 31.0.101.3358, codec=HD Audio Driver for Display Audio]]
[ WARN]   36 : [ Intel(R) USB 3.20 可扩展主机控制器 - 1.20 (Microsoft) (通用 USB xHCI 主机控制器)
 |-- USB 根集线器(USB 3.0) ((标准 USB 集线器)),  Intel(R) USB 3.10 可扩展主机控制器 - 1.20 (Microsoft) (通用 USB xHCI 主机控制器)
 |-- USB 根集线器(USB 3.0) ((标准 USB 集线器))
     |-- ChipSailing Fingerprint UsbDriver (<ChipSailing Electronics(ShenZhen)Co.,Ltd>)
     |-- USB Composite Device ((标准 USB 主控制器)) [s/n: 01.00.00]
         |-- HP HD Camera (Quanta) [s/n: 01.00.00]
         |-- HP IR Camera (Quanta) [s/n: 01.00.00]
     |-- 英特尔(R) 无线 Bluetooth(R) (Intel Corporation)
         |-- Bluetooth Device (Personal Area Network) (Microsoft)
         |-- Bluetooth Device (RFCOMM Protocol TDI) (Microsoft)
             |-- 蓝牙链接上的标准串行 (COM3) (Microsoft)
             |-- 蓝牙链接上的标准串行 (COM4) (Microsoft)
         |-- Intel Tile Device (Intel Corporation)
         |-- Microsoft 蓝牙 LE 枚举器 (Microsoft)
             |-- RAPOO 5.0KB (Microsoft)
                 |-- 符合蓝牙低能耗 GATT 的 HID 设备 (Microsoft)
                 |-- 蓝牙 LE 通用属性服务 (Microsoft)
                 |-- 设备信息服务 (Microsoft)
                 |-- 通用属性配置文件 (Microsoft)
                 |-- 通用访问配置文件 (Microsoft)
             |-- RAPOO BT4.0 Mouse (Microsoft)
                 |-- 符合蓝牙低能耗 GATT 的 HID 设备 (Microsoft)
                     |-- HID-compliant mouse (Microsoft)
                     |-- 符合 HID 标准的用户控制设备 (Microsoft)
                 |-- 蓝牙 LE 通用属性服务 (Microsoft)
                 |-- 设备信息服务 (Microsoft)
                 |-- 通用属性配置文件 (Microsoft)
                 |-- 通用访问配置文件 (Microsoft)
         |-- Microsoft 蓝牙枚举器 (Microsoft)
             |-- B.O.W (Microsoft)
             |-- Redmi AirDots 2 (Microsoft)
             |-- Redmi AirDots 2 (Microsoft)
             |-- Redmi AirDots 2 Avrcp 传输 (Microsoft)
             |-- Redmi AirDots 2 Avrcp 传输 (Microsoft)
             |-- Redmi AirDots 2 Hands-Free AG (Microsoft)
             |-- 服务发现服务 (Microsoft)
             |-- 蓝牙 HID 设备 (Microsoft)
                 |-- HID Keyboard Device ((标准键盘))
                 |-- 符合 HID 标准的用户控制设备 (Microsoft)
                 |-- 符合 HID 标准的用户控制设备 (Microsoft)
                 |-- 符合 HID 标准的用户控制设备 (Microsoft)
                 |-- 符合 HID 标准的用户控制设备 (Microsoft)
                 |-- 符合 HID 标准的系统控制器 ((标准系统设备))
             |-- 设备标识服务 (Microsoft)]

进程已结束,退出代码0

*/
    }
}
